<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>

    <%@ include file="/WEB-INF/views/include/header.jsp" %>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <!-- basic styles -->
    <%--<link href="assets/css/bootstrap.css" rel="stylesheet" />--%>
    <link rel="stylesheet" href="<s:url value="assets/css/font-awesome.min.css"> </s:url> "/>
    <!-- ace styles -->
    <link rel="stylesheet" href="<s:url  value="assets/css/ace.css"></s:url>"/>
    <!-- 新首页css 20180703-->
    <link rel="stylesheet" href="<s:url value="/assets/dist/css/newindex.css"></s:url>"/>
    <link rel="stylesheet" href="<s:url value="/assets/dist/css/content.css"></s:url>"/>
    <!--  -->
    <%--<link rel="stylesheet" href="newindex.css?v=123">--%>
    <!-- ace settings handler -->
    <script src="<s:url value="assets/js/ace-extra.min.js"></s:url> "></script>
    <style>
        <%--分布图css--%>
        #imgContainer {
            position: relative;
            width: 1200px !important;
            height: 380px;
            background-color: #fff;
        }
        .close-map{
            position: absolute;
            top:25px;
            right:25px;
            z-index: 999999999;
            border:2px solid red;
            border-radius: 100%;
            width: 25px;
            height: 25px;
            line-height: 18px;
            text-align: center;
            cursor: pointer;
            font-size: 25px;
            color: red;
        }

        #map-distribution{
            /*width: 100%;*/
            height: 380px;
            position: fixed;
            top:0;
            left:20%;
            z-index: -9999999;
        }
        #imgContainer img{
            width: 350px;
            margin:0 15px;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="row">
    <div id="map-distribution" style="overflow-y: scroll;">
        <div id="imgContainer">
            <div class="close-map">x</div>
            <img class='imgZoom'  src="./../../../assets/dist/img/map-img-3.jpg" alt="资源图片">
            <img class='imgZoom'  src="./../../../assets/dist/img/lyfbt.jpg" alt="资源图片">
            <%--
            <img class='imgZoom'  src="./../../../assets/dist/img/yt-1.jpg" alt="资源图片">
            <img class='imgZoom'  src="./../../../assets/dist/img/map-img-3.jpg" alt="资源图片">--%>
        </div>
    </div>
</div>

<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>
        <!-- 主内容 -->

        <div class="page-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="main-left">
                        <ul id="main-left-tab" class="nav nav-pills left-nav media-left-title ">
                            <%--<li class="active ">--%>
                            <%--<a class="b-left left-active" href="#index-qxqk" data-toggle="tab">全县情况</a>--%>
                            <%--</li>--%>
                            <li>
                                <a class="b-left left-active" href="#index-gzdt" data-toggle="tab">招商工作动态</a>
                            </li>
                            <li>
                                <a class="b-left" href="#index-zcfg" data-toggle="tab">政策法规</a>
                            </li>
                            <li>
                                <a class="b-left" href="#index-cyl" data-toggle="tab">产业链</a>
                            </li>
                            <li>
                                <a class="b-left" href="#index-zsbk" data-toggle="tab">招商百科</a>
                            </li>
                        </ul>
                        <div class="sub-title">招商工作动态</div>
                        <div class="tab-content theme-border need-resize">
                            <%--全县情况--%>
                            <%--<div id="index-qxqk" class="tab-pane fade in active">--%>
                            <%----%>
                            <%--</div>--%>
                            <%--招商工作动态--%>
                            <div id="index-gzdt" class="tab-pane fade in active"></div>
                            <%--重点项目情况--%>
                            <%--政府法规--%>
                            <div id="index-zcfg" class="tab-pane fade "></div>
                            <%--产业链--%>
                            <div id="index-cyl" class="tab-pane fade "></div>
                            <%--对外推荐资源--%>
                            <div id="index-zsbk" class="tab-pane fade "></div>
                            <div class=" left-shade"></div>
                            <div class="container-left">
                                <p class="title"><span class="head"></span><span class="close-left-modal" style="color: #ffffff">&times;</span></p>
                                <p class="content">弹出内容</p>
                            </div>
                        </div>
                    </div>
                    <div class="main-center">
                        <%--模态框--%>
                        <div class="modal fade" id="resourceModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                            <div class="modal-dialog">
                                <div class="modal-content modal-wrapper">
                                    <div class="modal-header modal-title">
                                        <button type="button" class="close close-btn" data-dismiss="modal" aria-hidden="true" style="opacity: 0">
                                            &times;
                                        </button>
                                        <%--<h4 class="modal-title" id="myModalLabel">--%>
                                        <%--模态框（Modal）标题--%>
                                        <%--</h4>--%>
                                    </div>
                                    <div class="modal-body modal-container">
                                    </div>
                                    <%--<div class="modal-footer">--%>
                                    <%--<button type="button" class="btn btn-default" data-dismiss="modal">关闭--%>
                                    <%--</button>--%>
                                    <%--</div>--%>
                                </div><!-- /.modal-content -->
                            </div><!-- /.modal -->
                        </div>
                        <div class="main-title">
                            <div class="main-title-item">永泰招商大数据管理系统</div>
                        </div>
                        <div class="main-nav-container">
                            <ul id="map-tab" class="nav nav-pills main-nav">
                                <li id="main-nav-gxz" class="active ">
                                    <a class="map-active  a-active" href="" data-toggle="dropdown">全县情况</a>
                                    <ul class="dropdown-menu  map-menu">
                                        <li id="main-nav-qxqk" class="handle-click">
                                            <a href="" data-toggle="tab">永泰全域情况</a>
                                        </li>
                                        <li id="main-nav-xz">
                                            <a href="" data-toggle="tab">各乡镇情况</a>
                                        </li>
                                    </ul>
                                </li>
                                <li id="main-nav-yq">
                                    <a class="a-active" href="" data-toggle="dropdown">园区</a>
                                    <ul class="dropdown-menu  map-menu">
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">智慧信息产业园</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">绿色食品产业园</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">商贸物流园</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">电商产业园</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">建筑大厦和金融大厦</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">建筑产业园</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">其它园区</a>
                                        </li>
                                    </ul>
                                </li>
                                <li id="main-nav-cy">
                                    <a class="a-active" href="" data-toggle="dropdown">产业</a>
                                    <ul class="dropdown-menu  map-menu">
                                        <li id="main-nav-ly" class="handle-click">
                                            <a href="" data-toggle="tab">全域旅游</a>
                                        </li>
                                        <li id="main-nav-ny" class="handle-click">
                                            <a href="" data-toggle="tab">生态农业</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">健康养生</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">信息产业</a>
                                        </li>
                                        <li class="handle-click">
                                            <a href="" data-toggle="tab">现代服务业</a>
                                        </li>
                                    </ul>
                                </li>
                                <li id="main-nav-zy">
                                    <a class="a-active" href="" data-toggle="dropdown">对外推介资源</a>
                                    <ul class="dropdown-menu  map-menu">
                                        <li class="resource-warpper">
                                            <a href="" class="resource-hover" data-toggle="dropdown">招商项目</a>
                                            <ul class="resource-list project" style="display: none;">
                                                <li class="resource-item">
                                                    1111
                                                </li>
                                                <li class="resource-item">
                                                    1111
                                                </li>
                                            </ul>
                                        </li>
                                        <li class="resource-warpper">
                                            <a href="" class="resource-hover" data-toggle="tab">招商资源</a>
                                            <ul class="resource-list resource" style="display: none;">
                                                <li class="resource-item">
                                                    1111
                                                </li>
                                                <li class="resource-item">
                                                    1111
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                        <div class="map-container">
                            <!-- 高德地图 -->
                            <div id="map-gd" class="need-resize">
                            </div>
                            <!-- 提供图片地图 -->
                            <div id="map-img" style="display: none;">
                                <%--<video id="img" loop="loop" width="100%" height="100%">--%>
                                <%--<source src="http://download.huashitong.net/%E6%A0%BC%E5%BC%8F%E5%B7%A5%E5%8E%82%E6%B0%B8%E6%B3%B0%E6%8B%9B%E5%95%86%E7%89%87.mp4" type="video/mp4">;--%>
                                <%--</video>--%>
                                <%--<img src="./../../../assets/dist/img/map-img-1.jpg" alt="资源图片">--%>
                            </div>
                            <div id="video-wapper" style="display: none;">
                                <video id="video" loop="loop" controls width="100%" height="100%">
                                    <source src="http://download.huashitong.net/%E6%A0%BC%E5%BC%8F%E5%B7%A5%E5%8E%82%E6%B0%B8%E6%B3%B0%E6%8B%9B%E5%95%86%E7%89%87.mp4"
                                            type="video/mp4">
                                    ;
                                </video>
                            </div>
                            <div id="map-change-btn">
                            </div>
                            <div class="video-btn"></div>
                        </div>
                    </div>
                    <div class="main-right">
                        <div class="right-l">
                            <div class="sub-title">永泰县招商情况</div>
                            <div class="theme-border">
                                <!-- 总完成率 -->
                                <div class="zwcl-container">
                                    <div class="black-btn">业务模块</div>
                                    <div id="zwcl-chart"></div>
                                    <span id="total-rate-num1">完成：
											<em> </em>项</span>
                                    <br>
                                    <span id="total-rate-num2">目标：
											<em> </em>项</span>
                                    <br>
                                    <%--<span id="total-rate-num3">总目标：--%>
                                    <%--<em> </em>亿</span>--%>
                                </div>
                                <!-- 项目情况 -->
                                <div class="third-title  third-title-hidden">大项目、好项目与一般项目</div>
                                <div id="xmqk-chart"></div>
                                <!-- 各月投资额情况 -->
                                <div class="third-title">市考核详情</div>
                                <div id="gytz-chart" class="need-resize"></div>
                            </div>
                        </div>
                        <div class="right-r">
                            <div class="sub-title hidden-font   sub-title-hidden">各招商单位考评得分情况</div>
                            <div class="theme-border gex-wapper">
                                <div class="gxz-wapper">
                                    <div class="zy-btn gxz-btn-active">专业</div>
                                    <div class="gxz-btn">乡镇</div>
                                    <div class="gbm-btn">部门</div>
                                </div>
                                <div id="gxz-chart"></div>
                            </div>
                            <div class="sub-title">招商小分队排名</div>
                            <div class="theme-border need-resize tab-left">
                                <div class="pm-wapper">
                                    <div class="zs-btn pm-btn-active">专业</div>
                                    <div class="xz-btn">乡镇</div>
                                    <div class="bm-btn">部门</div>
                                </div>
                                <%--专业--%>
                                <div class="zs-wapper">
                                    <div class="third-title">前三名</div>
                                    <div class="cytz-chart" style="padding: 10px">
                                        <div class="progress-wapper">
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width: 100%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">重大项目招商小分队
												总得分：<em>68.9</em>
											    </span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:65%"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">绿色食品产业招商小分队
												总得分：<em>44.8</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:58%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">现代服务业招商小分队
												总得分：<em>40.59</em>
											</span>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="third-title">后三名</div>
                                    <div class="qy-chart" class="need-resize" style="padding: 10px">
                                        <div class="progress-wapper">
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width: 31%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">文化产业招商小分队
												总得分<em>21.59</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:24%"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">健康养生招商小分队
												总得分<em>16.97</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:23%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">金融创新招商小分队
												总得分<em>16.51</em>
											</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <%--乡镇--%>
                                <div class="xz-wapper">
                                    <div class="third-title">前三名</div>
                                    <div class="cytz-chart" style="padding: 10px">
                                        <div class="progress-wapper">
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width: 100%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">梧桐镇
												总得分：<em>49.87</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:90%"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">盘谷乡
												总得分：<em>45.25</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:81%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">大洋镇
												总得分：<em>40.70</em>
											</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="third-title">后三名</div>
                                    <div class="qy-chart" class="need-resize" style="padding: 10px">
                                        <div class="progress-wapper">
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width: 40%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">盖洋乡
												总得分<em>20.07</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:31%"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">白云乡
												总得分<em>15.68</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:26%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">霞拔乡
												总得分<em>13.14</em>
											</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <%--部门--%>
                                <div class="bm-wapper">
                                    <div class="third-title">前三名</div>
                                    <div class="cytz-chart" style="padding: 10px">
                                        <div class="progress-wapper">
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width: 100%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">林业局
												总得分：<em>61.33</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:65%"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">发改局
												总得分：<em>40.16</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:58%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">人社局
												总得分：<em>32.76</em>
											</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="third-title">后三名</div>
                                    <div class="qy-chart" class="need-resize" style="padding: 10px">
                                        <div class="progress-wapper">
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width: 0%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">计生协会
												总得分<em>0</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:0%"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">行政服务中心
												总得分<em>0</em>
											</span>
                                            </div>
                                            <div class="progress-container clearfix">
                                                <div class="progress">
                                                    <div class="progress-bar progress-bar-1" style="width:0%;"></div>
                                                </div>
                                                <span class="pull-left progress-bar-info-1">物资总公司
												 总得分<em>0</em>
											</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /.page-content -->
    </div>
    <!-- /.main-content -->

</div>
<!-- /.main-container-inner -->
<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="icon-double-angle-up icon-only bigger-110"></i>
</a>
</div>

<%--地图模态框--%>
<!-- 模态框11111（Modal）  data-backdrop="static" 避免关闭  -->
<%--<div class="modal fade" id="myModal-map" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">--%>
<%--<div class="modal-dialog" style="width:1200px;overflow: hidden;">--%>
<%--&lt;%&ndash;<div id="imgContainer">&ndash;%&gt;--%>
<%--&lt;%&ndash;<img id="imageFullScreen"  src="./../../../assets/dist/img/map-img-3.jpg" alt="资源图片">&ndash;%&gt;--%>
<%--&lt;%&ndash;</div>&ndash;%&gt;--%>
<%--</div><!-- /.modal -->--%>
<%--</div>--%>
<%@ include file="/WEB-INF/views/include/footer.jsp" %>
<!-- basic scripts -->
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.10&key=a4af2bc72b9ff05c01429a198b7f910d"></script>
<!-- page specific plugin scripts -->
<script src="<s:url value="/assets/js/newindex.js"></s:url>"></script>
<script src="<s:url value="/assets/js/common.js"></s:url>"></script>

<!-- ace scripts -->
<script src="<s:url value="/assets/js/ace-elements.min.js"></s:url> "></script>
<script src="<s:url value="/assets/js/ace.min.js"></s:url>"></script>
<script src="<s:url value="/assets/dist/js/echarts.min.js"></s:url>"></script>
<%--分布图缩放js--%>
<%--<script src="<s:url value="/assets/map_suofang/js/jquery.min.js"></s:url>"></script>--%>
<%--<script src="<s:url value="/assets/map_suofang/js/e-smart-zoom-jquery.min.js"></s:url>"></script>--%>
<script src="<s:url value="/assets/map_suofang/javascripts/jquery.mousewheel.js"></s:url>"></script>
<script src="<s:url value="/assets/map_suofang/javascripts/jquery.imgZoom.js"></s:url>"></script>
<script src="<s:url value="/assets/map_suofang/javascripts/jquery.drag.js"></s:url>"></script>

<script>
    // alert(window.screen.width);
    $(function () {
        resizeModel(windowH);
        $(window).resize(function () {
            windowH = $(window).height();
            resizeModel(windowH);
        });
        //视频
        var video = document.getElementById("video");
        $('.video-btn').on('click', function () {
            $('#video-wapper').toggle();
            if (video.paused) {
                video.play();
            } else {
                video.pause();
            }
        })
        // navCtr();
        allChartInit();
// 地图 各乡镇坐标
        var gxzLnglats=[];
        var xzResoruce=[];
        $.ajax({
            url:"/modules/sys/resourceMaps/townsInfo",
            type :"POST",
            dataType : "json", //返回数据形式为json
            contentType:'application/json;charset=UTF-8',
            data:JSON.stringify({}),
            success:function(result) {
                console.log(result);
                var gxzName=[];
                for (var i=0;i<result.data.length;i++){
                    var resoruce={}
                    gxzName.push(result.data[i].cellCore);
                    gxzLnglats.push([result.data[i].longitude,result.data[i].latitude]);
                    resoruce['bigN']=result.data[i].bigN;
                    resoruce['bigT']=result.data[i].bigT;
                    resoruce['bigS']=result.data[i].bigS;
                    resoruce['name']=result.data[i].cellCore;
                    resoruce['type']='各乡镇情况'
                    xzResoruce.push(resoruce);
                }
                var ip=[118.843664, 25.997121]
                aMap.init(ip);
                aMap.addMapBorder();
                aMap.addCountyMasker(gxzLnglats,xzResoruce)
            }
        });
        /**
         * [gxzClick 各乡镇点击事件]
         * @return {[type]} [description]
         */
        function gxzClick() {
            $("#map-img").hide();
            $("#map-img img").attr("src","./../../../assets/dist/img/map-img-1.jpg");
            map.setMapStyle(mapStyle1);
            map.clearMap();
            aMap.addMapBorder();
            aMap.addCountyMasker(gxzLnglats,xzResoruce);
        }
        //页面初始化
        function ranking(param,p1,p2){
            $.ajax({
                url: "/team/teamrank/rankQuery",
                type: "POST",
                dataType: "json", //返回数据形式为json
                contentType: 'application/json;charset=UTF-8',
                data: JSON.stringify({'teamClass': param}),
                success: function (result) {

                    var arr1 = result.data.slice(0, 3); //前三名
                    var arr2 = result.data.slice(-3); //后三名
                    var arr3 = arr1.concat(arr2);

                    //前三
                    var html1 = "";
                    for (var i = 0; i < 3; i++) {
                        var percent1=parseFloat(arr3[i].clum).toFixed(2)*100;
                        html1 += '\
					    <div class="progress-container clearfix">\
                            <div class="progress">\
                                <div class="progress-bar progress-bar-1" style="width: '+percent1+'%;"></div>\
                            </div>\
                            <span class="pull-left progress-bar-info-1">'+arr3[i].teamname+'：<em>'+arr3[i].score+'</em></span>\
                        </div>\
                    ';
                    }
                    p1.html(html1);
                    // 后三
                    var html2 = "";
                    for (var i = 3; i < 6; i++) {
                        var percent2=parseFloat(arr3[i].clum).toFixed(2)*100;
                        html2 += '\
					    <div class="progress-container clearfix">\
                            <div class="progress">\
                                <div class="progress-bar progress-bar-1" style="width: '+percent2+'%;"></div>\
                            </div>\
                            <span class="pull-left progress-bar-info-1">'+arr3[i].teamname+'：<em>'+arr3[i].score+'</em></span>\
                        </div>\
                    ';
                    }
                    p2.html(html2);
                }
            });
        }
        var param='专业';
        var p1= $(".zs-wapper .cytz-chart");
        var p2= $(".zs-wapper .qy-chart");
        ranking(param,p1,p2);

        //招商小分队排名  专业
        $('.zs-btn').on('click', function () {
            $('.zs-wapper').show()
            $('.bm-wapper').hide()
            $('.xz-wapper').hide();
            $(this).addClass("pm-btn-active");
            $(this).siblings().removeClass("pm-btn-active");

            //    调用函数
            var param='专业';
            var p1= $(".zs-wapper .cytz-chart");
            var p2= $(".zs-wapper .qy-chart");
            ranking(param,p1,p2);
        })

        //部门
        $('.bm-btn').on('click', function () {
            $('.bm-wapper').show()
            $('.zs-wapper').hide();
            $('.xz-wapper').hide()
            $(this).addClass("pm-btn-active");
            $(this).siblings().removeClass("pm-btn-active");

            //    调用函数
            var param='部门';
            var p1= $(".bm-wapper .cytz-chart");
            var p2= $(".bm-wapper .qy-chart");
            ranking(param,p1,p2);
        })

        //乡镇
        $('.xz-btn').on('click', function () {
            $('.xz-wapper').show();
            $('.zs-wapper').hide();
            $('.bm-wapper').hide()
            $(this).addClass("pm-btn-active");
            $(this).siblings().removeClass("pm-btn-active");

            //    调用函数
            var param='乡镇';
            var p1= $(".xz-wapper .cytz-chart");
            var p2= $(".xz-wapper .qy-chart");
            ranking(param,p1,p2);
        })


        $('.gxz-btn').on('click', function () {
            xzClick();
            $(this).addClass("gxz-btn-active");
            $(this).siblings().removeClass("gxz-btn-active");
        });
        $('.gbm-btn').on('click', function () {
            gbmClick();
            console.log(1111);
            $(this).addClass("gxz-btn-active");
            $(this).siblings().removeClass("gxz-btn-active");
        });
        $('.zy-btn').on('click', function () {
            zyClick();
            $(this).addClass("gxz-btn-active");
            $(this).siblings().removeClass("gxz-btn-active");
        });
        $('#main-nav-xz').on('click', gxzClick);
        $('#main-nav-zy').on('click','a',function () {
            var title=$(this).text();
            var element=$(this).parent().children('ul');
            mainMapTitle(title,element);
        });

    })
    $('#main-nav-ly').on('click','a', function () {
        //lyClick
    });
    $('#main-nav-cy').on('click','.a-active',function () {
        var title=$(this).text();
        var element=$(this).parent().children('ul');
        mainMapTitle(title,element);
    })
    // $('#main-nav-ny').on('click', nyClick);
    $('#main-nav-yq').on('click','.a-active', function () {
        var title=$(this).text();
        var element=$(this).parent().children('ul');
        mainMapTitle(title,element);
    });
    $('#map-change-btn').on('click', function () {
        $(" #map-distribution").css("z-index","5555");
    });

    //点击切换背景图片
    $(".main-nav").on("click","li",function () {
        $(this).children(".a-active").addClass("map-active").parent().siblings().children().removeClass("map-active");
    })

    // $(".map-menu").on("click","li",function () {
    //     $(this).parent().prev().addClass("blues");
    // });

    function mainMapTitle(title,el) {
        $.ajax({
            url: "/modules/sys/resourceMaps/resourceQuery",
            type: "POST",
            dataType: "json", //返回数据形式为json
            contentType: 'application/json;charset=UTF-8',
            data: JSON.stringify({'type': title}),
            success: function (res) {
                if (res.code == "200") {
                    if (res.data != undefined) {
                        var html='';
                        var resource=''
                        var project=''
                        if(title !=='对外推介资源'){
                            for(var i=0;i<res.data.length;i++){
                                html+= '\<li class="handle-click">\
                                <a href="" data-toggle="tab">'+res.data[i].resourceName+'</a>\
                                </li>'
                            }
                            el.html(html);
                        }else{
                            console.log(res);
                            for(var i=0;i<res.data.length;i++){
                                if( res.data[i].title ==='招商项目'){
                                    for(var j=0;j<res.data[i].content.length;j++){
                                        project+='\<li class="resource-item handle-click">\
                                                <a href="" class="resource-click" data-toggle="tab" >'+res.data[i].content[j].resourceName+'</a>\
                                            </li>'
                                    }
                                    $('.project').html(project);
                                }else{
                                    for(var j=0;j<res.data[i].content.length;j++){
                                        resource+='\<li class="resource-item handle-click">\
                                          <a  href="" class="resource-click" data-toggle="tab" >  '+res.data[i].content[j].resourceName+'</a>\
                                            </li>'
                                    }
                                    $('.resource').html(resource)
                                }
                            }
                            // el.html(html);
                            // Main-map-nav
                            $('.resource-hover').hover(function () {
                                _this2 = $(this);
                                _this2.siblings('.resource-list').show();
                                _this2.siblings('.resource-list').hover(function () {
                                    $(this).show();
                                }, function () {
                                    $(this).hide();
                                });
                            },function () {
                                _this2.siblings('.resource-list').hide();
                            });
                        }
                    }
                    $('.handle-click').on('click','a',function () {
                        var title=$(this).text().trim()
                        $('#resourceModal').modal('show');
                        $('.modal-container').html('')
                        $.ajax({
                            url: "/modules/sys/resourceMaps/resourceQuery",
                            type: "POST",
                            dataType: "json", //返回数据形式为json
                            contentType: 'application/json;charset=UTF-8',
                            data: JSON.stringify({'resourceName':title}),
                            success: function (res) {
                                if(res.code=="200"){
                                    if(res.data != undefined){
                                        var str=res.data[0].content;
                                        $('.modal-container').html(escape2Html(str))
                                        function escape2Html(str) {
                                            var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
                                            return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
                                        }
                                    }
                                }
                            }
                        });
                    })
                }
            }
        })
    }
    /**
     * 左侧内容渲染 function
     */
    var paramss = "招商工作动态";
    var p6 = $("#index-gzdt");
    var p8="0";
    var index=1;
    function forenchTitle(paramss,p6,p8){
        $.ajax({
            url: "/resourceNews/resourceQuery",
            type: "POST",
            dataType: "json", //返回数据形式为json
            contentType: 'application/json;charset=UTF-8',
            data: JSON.stringify({'assTitle': paramss}),
            success: function (result) {
                console.log(result);
                var html="";
                if(result.data !== undefined){
                    for(var i= 0; i<result.data.length;i++){
                        var list=result.data[i];
                        var content='';
                        for(var j=0;j<list.content.length;j++){

                            if(index==1){
                                var fristModal=list.content[0].content
                                var borther= $('.container-left .content')
                                $('.container-left .head').html(list.content[0].title);
                                $(".left-shade").fadeIn(500);
                                $(".container-left").fadeIn(500);
                                borther.html(escape2Html(fristModal))
                                index++
                            }
                            content+= '<div data-type='+list.content[j].sysId+' class="container-list">\
                           <h2 class="content-item" id="show-left-modal" ">'+list.content[j].title+'</h2>\
                                <em>'+list.content[j].updDate+'</em>\
                              </div>\
                              ';
                        }

                        html += '\
                    <div class="contents">\
                        <div class="title-wapper">\
                            <a  class="hidden-font" title='+list.title+' href="#my-targets'+i+p8+'" data-toggle="collapse">'+list.title+'</a>\
                        </div><div class="collapse"  id="my-targets'+i+p8+'">'+content+ '</div></div>\
                     ';
                    }
                    p6.html(html);
                }
            }
        });
    }
    forenchTitle(paramss,p6,p8);


    function escape2Html(str) {
        var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
        return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
    }

    //左侧tab按钮
    $("#main-left-tab").on("click","li",function () {
        // $(".main-left .sub-title").text($(this).text());
        $(this).children(".b-left").addClass("left-active").parent().siblings().children().removeClass("left-active");
    });

    // 点击tab事件
    $('#main-left-tab').on('click',"li:nth-child(1)", function () {
        $(".left-shade").fadeOut(1000);
        $(".container-left").fadeOut(1000);
        //    调用函数
        var paramss="招商工作动态";
        var p6 = $("#index-gzdt");
        var p8="1";
        $('.main-left .sub-title').html(paramss);
        forenchTitle(paramss,p6,p8);
    })

    $('#main-left-tab').on('click',"li:nth-child(2)", function () {
        $(".left-shade").fadeOut(1000);
        $(".container-left").fadeOut(1000);
        //    调用函数
        var paramss="政策法规";
        var p6 = $("#index-zcfg");
        var p8="2";
        $('.main-left .sub-title').html(paramss);
        forenchTitle(paramss,p6,p8);
    })

    $('#main-left-tab').on('click',"li:nth-child(3)", function () {
        $(".left-shade").fadeOut(1000);
        $(".container-left").fadeOut(1000);
        //    调用函数
        var paramss="产业链";
        console.log(paramss);
        var p6 = $("#index-cyl");
        var p8="3";
        $('.main-left .sub-title').html(paramss);
        forenchTitle(paramss,p6,p8);
    })

    $('#main-left-tab').on('click',"li:nth-child(4)", function () {
        $(".left-shade").fadeOut(1000);
        $(".container-left").fadeOut(1000);
        //    调用函数
        var paramss="招商百科";
        var p6 = $("#index-zsbk");
        var p8="4";
        $('.main-left .sub-title').html(paramss);
        forenchTitle(paramss,p6,p8);
    })


    /**
     * 点击标题渲染数据
     */
    $(".tab-content").on("click",".container-list",function () {
        var type=$(this).data("type");
        $('.contents').hide()
        var title=$(this).children('.content-item').html();
        $('.container-left .head').html(title);
        var borther= $('.container-left .content')
        $(".left-shade").fadeIn(500);
        $(".container-left").fadeIn(500);
        showShade();
        $.ajax({
            url: "/resourceNews/resourceQuery",
            type: "POST",
            dataType: "json", //返回数据形式为json
            contentType: 'application/json;charset=UTF-8',
            data: JSON.stringify({'sysId': type}),
            success: function (result) {
                if(result.data !== undefined){
                    var str=result.data[0].content;
                    borther.html(escape2Html(str));
                }
            }
        })
    })

    //    点击标题换背景
    $(".tab-content").on("click",".title-wapper",function () {
        $(this).addClass("bgjpg").parent().siblings().children(".title-wapper").removeClass("bgjpg");
    });


    /**
     * 中间地图部分*********************************************************************************************
     */

    $(function() {
        $('.handle-click').on('click','a',function () {
            var title=$(this).text().trim()
            $('#resourceModal').modal('show');
            $('.modal-container').html('')
            $.ajax({
                url: "/modules/sys/resourceMaps/resourceQuery",
                type: "POST",
                dataType: "json", //返回数据形式为json
                contentType: 'application/json;charset=UTF-8',
                data: JSON.stringify({'resourceName':title}),
                success: function (res) {
                    if(res.code=="200"){
                        if(res.data != undefined){
                            var str=res.data[0].content;
                            $('.modal-container').html(escape2Html(str))
                            function escape2Html(str) {
                                var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
                                return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
                            }
                        }
                    }
                }
            });
        })
        //浏览器大小发生改变
        $(window).resize(function () {
            showShade();
        });

        // //模态框出现
        // $("a").bind("click", function () {
        //     $(".left-shade").fadeIn(1000);
        //     $(".container-left").fadeIn(1000);
        //     showShade();
        //     $(this).css("display", "none");
        // });
        //点击span关闭
        $(".close-left-modal").bind("click", function () {
            $('.contents').show();
            $(".left-shade").fadeOut(1000);
            $(".container-left").fadeOut(1000);
        });

        //居中显示
        function showShade() {
            var $vW = $('.tab-content').width();
            console.log(2222);
            var $w = $(".container-left").outerWidth();
            var $vH = $('.tab-content').height();
            var $h = $(".container-left").outerHeight();
            $(".container-left").css({"left": ($vW - $w) / 2 + "px", "top": ($vH - $h) / 2 + "px"});
        };
        $(document).keyup(function(ev){
            if(ev.keyCode == 27){
//          $("span").click();
                $(".close").trigger("click");
            }
        })
        //跳转业务模块
        $('.black-btn').on('click',function () {
            window.location.href="/chart/show/userLogin"
        })
    })


    /*
    * 招商项目分布图缩放功能
    * */
    $(function () {
        //图片缩放调用
        $(".imgZoom").imgZoom();
        $(".close-map").click(function () {
            $(" #map-distribution").css("z-index","-9999999");
        });
    })
</script>
</body>
</html>

